package com.xlh.dto.course;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

/**
 * 章节技能基本信息
 * <p>
 * Created by lx on 2019/1/28.
 */
@Data
public class ChapterTechnologyDTO {

    @ApiModelProperty(value = "章节id")
    private Long id;

    @ApiModelProperty(value = "章节编号")
    private String number;

    @ApiModelProperty(value = "课程id")
    private Long courseId;

    @ApiModelProperty(value = "章节基本id")
    private Long chapterBasicId;

    @ApiModelProperty(value = "章节名称")
    private String name;

    @ApiModelProperty(value = "章节类型名称")
    private String typeName;

    @ApiModelProperty(value = "章节类型 1：理论课 2：实验课 3：理论课及实验课")
    private Integer type;

    @ApiModelProperty(value = "章节简介")
    private String introduction;

    @ApiModelProperty(value = "章节技术，用逗号分隔每个技术id")
    private String technologyIds;

    @JsonIgnore
    @ApiModelProperty(value = "父级id")
    private Long parentId;

    @ApiModelProperty(value = "显隐 0 显 1 隐")
    private Integer falg;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;

        if (o == null || getClass() != o.getClass()) return false;

        ChapterTechnologyDTO that = (ChapterTechnologyDTO) o;

        return new EqualsBuilder()
                .append(chapterBasicId, that.chapterBasicId)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(chapterBasicId)
                .toHashCode();
    }

}
